home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / mx / skins / halo / WindowMaximizeButtonSkin.as < prev    next >
Text File  |  2009-12-16  |  4KB  |  114 lines

  1. package mx.skins.halo
  2. {
  3.    import flash.system.Capabilities;
  4.    import mx.controls.Image;
  5.    import mx.core.UIComponent;
  6.    import mx.core.mx_internal;
  7.    import mx.states.SetProperty;
  8.    import mx.states.State;
  9.    
  10.    use namespace mx_internal;
  11.    
  12.    public class WindowMaximizeButtonSkin extends UIComponent
  13.    {
  14.       
  15.       private static var winMaxUpSkin:Class = WindowMaximizeButtonSkin_winMaxUpSkin;
  16.       
  17.       private static var winMaxDisabledSkin:Class = WindowMaximizeButtonSkin_winMaxDisabledSkin;
  18.       
  19.       private static var winRestoreOverSkin:Class = WindowMaximizeButtonSkin_winRestoreOverSkin;
  20.       
  21.       private static var macMaxOverSkin:Class = WindowMaximizeButtonSkin_macMaxOverSkin;
  22.       
  23.       private static var winRestoreUpSkin:Class = WindowMaximizeButtonSkin_winRestoreUpSkin;
  24.       
  25.       private static var macMaxUpSkin:Class = WindowMaximizeButtonSkin_macMaxUpSkin;
  26.       
  27.       private static var winMaxDownSkin:Class = WindowMaximizeButtonSkin_winMaxDownSkin;
  28.       
  29.       private static var winRestoreDownSkin:Class = WindowMaximizeButtonSkin_winRestoreDownSkin;
  30.       
  31.       private static var macMaxDownSkin:Class = WindowMaximizeButtonSkin_macMaxDownSkin;
  32.       
  33.       mx_internal static const VERSION:String = "3.5.0.12683";
  34.       
  35.       private static var winMaxOverSkin:Class = WindowMaximizeButtonSkin_winMaxOverSkin;
  36.       
  37.       private static var macMaxDisabledSkin:Class = WindowMaximizeButtonSkin_macMaxDisabledSkin;
  38.        
  39.       
  40.       private var isMac:Boolean;
  41.       
  42.       private var skinImage:Image;
  43.       
  44.       public function WindowMaximizeButtonSkin()
  45.       {
  46.          super();
  47.          isMac = Capabilities.os.substring(0,3) == "Mac";
  48.       }
  49.       
  50.       override public function get measuredWidth() : Number
  51.       {
  52.          if(skinImage.measuredWidth)
  53.          {
  54.             return skinImage.measuredWidth;
  55.          }
  56.          return 12;
  57.       }
  58.       
  59.       private function initializeStates() : void
  60.       {
  61.          var _loc1_:State = new State();
  62.          _loc1_.name = "up";
  63.          var _loc2_:SetProperty = new SetProperty();
  64.          _loc2_.name = "source";
  65.          _loc2_.target = skinImage;
  66.          _loc2_.value = !!isMac ? macMaxUpSkin : winMaxUpSkin;
  67.          _loc1_.overrides.push(_loc2_);
  68.          states.push(_loc1_);
  69.          var _loc3_:State = new State();
  70.          _loc3_.name = "down";
  71.          var _loc4_:SetProperty;
  72.          (_loc4_ = new SetProperty()).name = "source";
  73.          _loc4_.target = skinImage;
  74.          _loc4_.value = !!isMac ? macMaxDownSkin : winMaxDownSkin;
  75.          _loc3_.overrides.push(_loc4_);
  76.          states.push(_loc3_);
  77.          var _loc5_:State;
  78.          (_loc5_ = new State()).name = "over";
  79.          var _loc6_:SetProperty;
  80.          (_loc6_ = new SetProperty()).name = "source";
  81.          _loc6_.target = skinImage;
  82.          _loc6_.value = !!isMac ? macMaxOverSkin : winMaxOverSkin;
  83.          _loc5_.overrides.push(_loc6_);
  84.          states.push(_loc5_);
  85.          var _loc7_:State;
  86.          (_loc7_ = new State()).name = "disabled";
  87.          var _loc8_:SetProperty;
  88.          (_loc8_ = new SetProperty()).name = "source";
  89.          _loc8_.target = skinImage;
  90.          _loc8_.value = !!isMac ? macMaxDisabledSkin : winMaxDisabledSkin;
  91.          _loc7_.overrides.push(_loc8_);
  92.          states.push(_loc7_);
  93.       }
  94.       
  95.       override protected function createChildren() : void
  96.       {
  97.          skinImage = new Image();
  98.          addChild(skinImage);
  99.          initializeStates();
  100.          skinImage.setActualSize(12,13);
  101.          skinImage.move(0,0);
  102.       }
  103.       
  104.       override public function get measuredHeight() : Number
  105.       {
  106.          if(skinImage.measuredHeight)
  107.          {
  108.             return skinImage.measuredHeight;
  109.          }
  110.          return 13;
  111.       }
  112.    }
  113. }
  114.